// userStore.js
import { types } from 'mobx-state-tree';

const User = types.model('User', {
  id: types.identifier,
  username: types.string,
  email: types.string,
});

const UserStore = types.model('UserStore', {
  currentUser: types.maybeNull(User),
}).actions(self => ({
  setCurrentUser(user) {
    self.currentUser = user;
  },
  clearCurrentUser() {
    self.currentUser = null;
  },
}));

export default UserStore;
